import { Component, OnInit } from '@angular/core';
import { NavController, ModalController, ActionSheetController } from '@ionic/angular';
import { WirelessModal } from '@modals/wire-less/wire-less';
import { QRScannerModal } from '@modals/qr-scanner/qr-scanner';

@Component({
    selector: 'score',
    templateUrl: 'score.html',
    styleUrls: ['score.scss']
})

export class ScorePage implements OnInit {
    scoreList;
    imgType = [];
    constructor(public navCtrl: NavController, public modalCtrl: ModalController) {
    }
    ngOnInit() {
        this.scoreList = [
            { id: 20069, name: '勘察' },
            { id: 20070, name: '生产' },
            { id: 20071, name: '测试' },
            { id: 20072, name: '安装' },
            { id: 20073, name: '验收' },
            { id: 20074, name: '运营' },
            { id: 20075, name: '空调推广' },
            { id: 20076, name: '运维监控' },
            { id: 20077, name: '无线模块设置' },
            { id: 20131, name: 'IOT设备唯一性验证' }]
            ;
    }

    async toNext(i) {
        console.log(i);
        switch (i) {
            case 3:
                this.navCtrl.navigateForward('tabs/my/InstallPage');
                break;
            case 7:
                this.navCtrl.navigateForward('tabs/my/MonitorPage');
                break;
            case 8:
                const modal = await this.modalCtrl.create({
                    component: WirelessModal,
                });
                modal.present(); // 页面展示
                break;
            case 9:
                const QRmodal = await this.modalCtrl.create({
                    component: QRScannerModal
                });
                QRmodal.present();
                break;
        }
    }
}
